
//import add from './admin-add.js';
/*import("./admin-add.js").then(m=>{
    console.debug(m);
});*/



let datagrid = document.querySelector("._datagrid");
let loadData = function () {
    fetch("SportingEvents-list.let").then((r) => r.json()).then((data) => {
        console.debug(data);
        datagrid.innerHTML = "";
        data.forEach((item) => {
            let tr = document.createElement("tr");
            tr.innerHTML = `
            <td>${item.sportingId}</td>
            <td>${item.sportingName}</td>
            <td>${item.sportingIntroduce}</td>
            
            <td class="p-2"><div class="btn-group btn-group-sm">
                <button type="button" class="btn btn-primary" title="修改"><i class="fa fa-edit"></i></button>
                <button type="button" class="btn btn-danger _delete" title="删除"><i class="fa fa-remove"></i></button>
            </div></td>`;
            datagrid.appendChild(tr);

        });

    }).catch(e=> {
        console.error(e);
    });
}
loadData();




